package com.platform.service;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;
import java.util.Map;

import com.platform.dao.FarmContentMapper;
import com.platform.entity.FarmChapterEntity;
import com.platform.entity.FarmContentEntity;
import com.platform.service.FarmContentService;

/**
 * 内容表四级Service实现类
 *
 * @author lipengjun
 * @email 939961241@qq.com
 * @date 2020-02-10 22:01:54
 */
@Service("farmContentService")
public class FarmContentService{
    @Autowired
    private FarmContentMapper farmContentMapper;
    
    /**
     * 根据parentId查找
     * @param id
     * @return
     */
     public List<FarmContentEntity> findByParentId(Integer id){
     	return farmContentMapper.findByParentId(id);
     }
    
    public FarmContentEntity queryObject(Integer id) {
        return farmContentMapper.selectByPrimaryKey(id);
    }

    
    public List<FarmContentEntity> queryList(Map<String, Object> map) {
        return farmContentMapper.queryList(map);
    }

    
    public int queryTotal(Map<String, Object> map) {
        return farmContentMapper.queryTotal(map);
    }

    
    public int save(FarmContentEntity farmContent) {
        return farmContentMapper.insertSelective(farmContent);
    }

    
    public int update(FarmContentEntity farmContent) {
        return farmContentMapper.updateByPrimaryKeySelective(farmContent);
    }

    
    public int delete(Integer id) {
        return farmContentMapper.deleteByPrimaryKey(id);
    }

    
    public int deleteBatch(Integer[] ids) {
        return farmContentMapper.deleteBatch(ids);
    }
}
